package com.ruoyi.game.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.game.mapper.GamePacketRecordMapper;
import com.ruoyi.game.domain.GamePacketRecord;
import com.ruoyi.game.service.IGamePacketRecordService;

/**
 * 红包记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-17
 */
@Service
public class GamePacketRecordServiceImpl implements IGamePacketRecordService 
{
    @Autowired
    private GamePacketRecordMapper gamePacketRecordMapper;

    /**
     * 查询红包记录
     * 
     * @param packetId 红包记录主键
     * @return 红包记录
     */
    @Override
    public GamePacketRecord selectGamePacketRecordByPacketId(Long packetId)
    {
        return gamePacketRecordMapper.selectGamePacketRecordByPacketId(packetId);
    }

    /**
     * 查询红包记录列表
     * 
     * @param gamePacketRecord 红包记录
     * @return 红包记录
     */
    @Override
    public List<GamePacketRecord> selectGamePacketRecordList(GamePacketRecord gamePacketRecord)
    {
        return gamePacketRecordMapper.selectGamePacketRecordList(gamePacketRecord);
    }

    /**
     * 新增红包记录
     * 
     * @param gamePacketRecord 红包记录
     * @return 结果
     */
    @Override
    public int insertGamePacketRecord(GamePacketRecord gamePacketRecord)
    {
        return gamePacketRecordMapper.insertGamePacketRecord(gamePacketRecord);
    }

    /**
     * 修改红包记录
     * 
     * @param gamePacketRecord 红包记录
     * @return 结果
     */
    @Override
    public int updateGamePacketRecord(GamePacketRecord gamePacketRecord)
    {
        gamePacketRecord.setUpdateTime(DateUtils.getNowDate());
        return gamePacketRecordMapper.updateGamePacketRecord(gamePacketRecord);
    }

    /**
     * 批量删除红包记录
     * 
     * @param packetIds 需要删除的红包记录主键
     * @return 结果
     */
    @Override
    public int deleteGamePacketRecordByPacketIds(Long[] packetIds)
    {
        return gamePacketRecordMapper.deleteGamePacketRecordByPacketIds(packetIds);
    }

    /**
     * 删除红包记录信息
     * 
     * @param packetId 红包记录主键
     * @return 结果
     */
    @Override
    public int deleteGamePacketRecordByPacketId(Long packetId)
    {
        return gamePacketRecordMapper.deleteGamePacketRecordByPacketId(packetId);
    }
}
